import request from '@/utils/request'

export default{
    // 通过输入车辆信息获取信息（第一次页面加载也能获取信息）
    getCompanyListData(token, page, size, formInline){
        return request({
            url: `/monitor/companyList/search/${token}/${page}/${size}`,
            method: 'post',
            data: formInline
        })
    },

    // 通过选择所属公司来获取选择的公司名下信息
    getCompanyListDataByCompany(token, page, size, company){
        return request({
            url: `/monitor/companyList/select/${token}/${page}/${size}`,
            method: 'post',
            data: company
        })
    },

    // 获取与id对应的车队信息
    getFleet(id){
        return request({
            url: `/companyList/company/${id}`,
            method: 'get',
            data: id
        })
    },

    // 更改车队信息
    updateFleet(form){
        return request({
            url: '/companyList/company',
            method: 'put',
            data: form
        })
    },

    // 添加车队
    addFleet(form){
        return request({
            url: '/companyList/company',
            method: 'post',
            data: form
        })
    },

    //删除车队
    deleteById(id){
        return request({
            url: '/companyList/fleet',
            method: 'delete',
            data: id
        })
    },
}